home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / editor / mintr151.zip / MINITRUE.DOC < prev    next >
Text File  |  1996-08-23  |  56KB  |  1,154 lines

  1.        MiniTrue 1.5 Instructions Copyright (c) 1995-6 by Splunge Software
  2.  
  3.                                   Contents
  4.  
  5.      1   - Introduction
  6.        1-1 description
  7.        1-2 requirements
  8.        1-3 license
  9.        1-4 miscellaneous
  10.  
  11.      2   - Command Line Syntax
  12.        2-1 overview
  13.        2-2 command line options
  14.        2-3 files
  15.        2-4 strings
  16.        2-5 options in depth
  17.  
  18.      3   - Regular Expressions
  19.        3-1 introduction
  20.        3-2 sets
  21.        3-3 variable occurrences
  22.        3-4 replacements
  23.        3-5 examples
  24.  
  25.      4   - Text Display
  26.        4-1 display infomation
  27.        4-2 commands
  28.  
  29.      5   - Examples
  30.  
  31.      Appendix A - File Recovery
  32.      Appendix B - Return Values
  33.  
  34.  
  35.   PART 1 -                     Introduction
  36.  
  37. 1-1 Description
  38.  
  39.     MiniTrue is a fast and versatile search/replace utility run from the
  40. DOS command line. MiniTrue synthesizes the functionality of such
  41. stalwarts as sed, more/less and grep while offering complete
  42. interactivity and a straightforward syntax. MiniTrue is freeware and is
  43. not crippled in any manner. MiniTrue searches the selected file(s) for
  44. the desired string(s). Once a string is found, it is displayed on the
  45. screen along with its context, which can be scrolled through if desired.
  46. If a replacement has been specified for the found string, MiniTrue will
  47. prompt to see if the found string should be changed. These three phases
  48. of operation are explained in more detail: (* denotes a new feature)
  49.  
  50.  
  51. Search:
  52.  
  53.   + All the filenames that will fit on the command line can be
  54.     searched. Wildcards in the filenames are allowed.
  55.  
  56.   + Over 40 strings can be searched for at a time.
  57.  
  58.   + If the size of the command line buffer is inadequate, input files
  59.     containing filenames and strings can be used.
  60.  
  61.   + Subdirectories can be searched recursively, making disk-wide
  62.     searches easy to implement.
  63.  
  64.   + Regular expressions (similar to UNIX basic regular expressions) are
  65.     supported.
  66.  
  67.   + No limits on either file size or line length
  68.  
  69.   + The search strings can be linked to form unions. All the strings in
  70.     the union must be present within a specific region for a find to be
  71.     reported. *The region for the union can be varied by either lines or
  72.     bytes.
  73.  
  74.   + *Minitrue can decompress archives before searching them. The default
  75.     dearchiver is PKUNZIP but most popular dearchivers can be used. The
  76.     archive files are not altered in any manner.
  77.  
  78.   + MiniTrue is fast. A 486+ computer searching for one fixed string
  79.     should scan at least 1MB per second. (On my AMD 5x86, MiniTrue can
  80.     scan roughly 600MB of files in approximately 6 minutes).
  81.  
  82.  
  83. Display:
  84.  
  85.   + *MiniTrue 1.5 does not limit the amount of viewable text to one
  86.     screen; it allows scrolling through the entire file in the manner of
  87.     the textreaders less and more. If no strings are specified, MiniTrue
  88.     can function as a textreader.
  89.  
  90.   + Can display context in hexadecimal mode.
  91.  
  92.   + Lines longer than 80 characters are wrapped around, making
  93.     horizontal scrolling unnecessary.
  94.  
  95.   + *Support for nonstandard SVGA modes such as 132 * 43
  96.  
  97.   + MiniTrue can bypass its textviewer mode and write all the lines
  98.     containing matching strings to standard output a la grep.
  99.     *Nonmatching lines, all lines or just the matching strings can be
  100.     sent to standard output as well. Line numbers and file names can be
  101.     included if desired.
  102.  
  103.   + *Accelerated scrolling - The longer the up/down arrow key is
  104.     pressed, the faster MiniTrue will scroll through a file. This
  105.     feature can be disabled.
  106.  
  107.   + *Regular expression color coding - Each part of the regular
  108.     expression will have a different color text.
  109.  
  110.  
  111. Replace:
  112.  
  113.   + Prompting is not mandatory - MiniTrue can make all replacements
  114.     automatically.
  115.  
  116.   + A substitute replacement string can be entered. The region of text
  117.     to be replaced can be altered as well.
  118.  
  119.   + Backup files can be made in order to safeguard against the
  120.     possibility of unwanted changes. *Either the original file or the
  121.     altered file can be saved with a new extension. Backups will never
  122.     overwrite previously existing backup files.
  123.  
  124.   + *If regular expressions are used, the replacement string can include
  125.     all or part(s) of the found string.
  126.  
  127.  
  128. Other features of MiniTrue 1.5 include:
  129.  
  130.   + *Capacity to automatically generate a batch file from the given
  131.     command line arguments.
  132.  
  133.   + The number of finds/replacements (for both files and strings) can be
  134.     printed when MiniTrue is done.
  135.  
  136.   + *A log file reporting the locations of the finds and replacements
  137.     can be generated.
  138.  
  139.   + .EXE size of only 76K results in quick startup.
  140.  
  141.  
  142. 1-2 Requirements
  143.  
  144.     MiniTrue should work on virtually all PCs from 8088s on. About 200K
  145. of free memory is needed. The amount of free space on the disk must be
  146. greater than the size of the largest changed file. For MiniTrue to
  147. alter a 1MB file originally on a diskette, the file must be copied to a
  148. hard drive first. If the /z option is used to scan zipped files, enough
  149. free space on the disk must be present to store the largest uncompressed
  150. file.
  151.  
  152.  
  153. 1-3 License
  154.  
  155.     This program is freeware, meaning you can use and distribute this
  156. program in any manner you desire without being nagged or obligated in
  157. any way to send in a registration fee. The copyright remains under
  158. control of the programmer. The only manner by which a fee may be
  159. involved in the distribution of the program is if this program is
  160. included on an archive CD-ROM. All other means of charging for this
  161. program require prior permission from Splunge Software. Use this program
  162. at your own risk. No liability will be accepted for any loss resulting
  163. from any usage of this program. SPLUNGE SOFTWARE DISCLAIMS ALL
  164. WARRANTIES EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
  165. WARRANTY OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  166.  
  167.  
  168. 1-4 Miscellaneous
  169.  
  170.     The name of the program is the shorthand form of Ministry of Truth,
  171. which in George Orwell's _1984_ was the name of the bureaucracy
  172. responsible for perpetually revising historical documents. Many
  173. revisions just involved the replacement of one word with another. See
  174. the Monty Python sketch "20th Century Vole" (aka "The Film Writer's
  175. Sketch") for information on the meaning of Splunge.
  176.  
  177.     Please send all comments, suggestions or bug reports to
  178. apipkin@nando.net
  179.  
  180.     See the MiniTrue home page at http://www.webbuild.com/~apipkin for
  181. the latest versions, bug reports, etc.
  182.  
  183.     Thanks to Michael Abrash for enlightening me to Boyer-Moore
  184. algorithms in Chapter 14 of _Zen of Code Optimization_. MiniTrue uses a
  185. Boyer-Moore algorithm written in assembler modified to perform case
  186. insensitive searches. Thanks to this algorithm, searching (for one fixed
  187. string) takes no more than 5% of execution time, with file operations
  188. accounting for the remainder.
  189.  
  190.  
  191.                         Part 2 Command Line Syntax
  192.  
  193. 2-1 Overview
  194.  
  195. The basic command line format is as follows:
  196.  
  197.     mt [options] [files] / [strings]
  198.     mt /abc *.txt *.doc / foo = bar foobar fubar = "bar foo"
  199.  
  200.     Because the number of both filenames and strings is variable, the
  201. slash is needed to separate the two. If only one thing needs to be
  202. searched, the slash can be omitted. With no slash, the first argument
  203. following the options is considered the filename and the remainder are
  204. the strings. Redirected standard input is counted as a file, so all the
  205. arguments after the options are considered strings if the output of
  206. another program is piped into MiniTrue. These are examples of command
  207. lines without the separator slash:
  208.  
  209.     mt [options] file [strings]       program | mt [options] strings
  210.     mt /q unixfile.txt \n = \r\n      dir /s |  mt "01-01-96"
  211.  
  212.     If the strings are omitted, MiniTrue will function in a manner
  213. similar to the textviewers more and less. The start of the file will be
  214. displayed and scrolling will enable the remainder of the file to be
  215. viewed. More than one file can be viewed. These command lines will
  216. activat